# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=XML-SAX
pkgname=perl-${_realname}
pkgver=0.99
pkgrel=2
pkgdesc="Simple API for XML"
arch=('any')
url="http://search.cpan.org/dist/XML-SAX"
groups=('perl-modules')
license=('GPL' 'PerlArtistic')
depends=('perl' 'perl-XML-SAX-Base' 'perl-XML-NamespaceSupport')
options=('!emptydirs')
install=perl-xml-sax.install
source=("http://www.cpan.org/authors/id/G/GR/GRANTM/${_realname}-${pkgver}.tar.gz"
        'perl-xml-sax.patch')
md5sums=('290f5375ae87fdebfdb5bc3854019f24'
         'f114c4aad3221d3e7d8314d13b84a869')

prepare() {
  cd ${srcdir}/${_realname}-${pkgver}
  patch -Np1 -i "${srcdir}/perl-xml-sax.patch"
}

build() {
  cd ${srcdir}/${_realname}-${pkgver}
  PERL_MM_USE_DEFAULT=1 perl Makefile.PL INSTALLDIRS=vendor
  make
}

check() {
  cd ${srcdir}/${_realname}-${pkgver}
  make test
}

package() {
  cd ${srcdir}/${_realname}-${pkgver}
  make install DESTDIR=$pkgdir

  find $pkgdir -name '.packlist' -delete
  find $pkgdir -name '*.pod' -delete
}
